package com.woniuxy.microzuulserver.configure;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: huhenggg
 * @Date: 2021/1/20 0020 下午 2:34
 */
@Configuration
public class SpringMVCConfigure implements WebMvcConfigurer {
    /**
     * 跨域支持
     * @param registry
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowCredentials(true).
                allowedMethods("GET","POST","PUT","DELETE");
    }
}
